package com.cms.recursoshumanos.ui.user.familiar;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.Ui;
import net.rim.device.api.ui.XYEdges;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.SeparatorField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.decor.BorderFactory;

import com.cms.recursoshumanos.component.base.CustomListElement;
import com.cms.recursoshumanos.component.base.TwoColumnField;
import com.cms.recursoshumanos.component.base.URLBitmapField;
import com.cms.recursoshumanos.constant.Constant;
import com.cms.recursoshumanos.container.ForegroundManager;
import com.cms.recursoshumanos.container.ListStyleButtonSetManager;
import com.cms.recursoshumanos.container.TwoColumnFieldManager;
import com.cms.recursoshumanos.object.Familiar;
import com.cms.recursoshumanos.ui.RecursosHumanosScreen;
import com.cms.recursoshumanos.utilities.Tool;

/**
 * A class extending the MainScreen class, which provides default standard
 * behavior for BlackBerry GUI applications.
 */

public final class DetailFamiliarScreen extends RecursosHumanosScreen
{
	public static DetailFamiliarScreen instance = null;
	
	private Familiar elFamiliar;
	
	private ForegroundManager _foreground;
	
	private URLBitmapField foto_familiar;
	
	HorizontalFieldManager hfm;
	CustomListElement lblNombreFamiliar, lblApellidoFamiliar, 
						lblFechaNacFamiliar,lblSexoFamiliar,
						lblParentescoNombre, lblCiFamiliar;
	TwoColumnFieldManager twoColumnManager;
	TwoColumnField twoColumnField;
	LabelField lblInformacionPersonal;
	Manager _content;
	
	
	public static DetailFamiliarScreen getInstance(Familiar elFamiliar)
	{
		if (instance == null)
		{
			return new DetailFamiliarScreen(elFamiliar);
		}
		else
		{
			return instance;
		}
	}
	public DetailFamiliarScreen(Familiar elFamiliar) 
	{
		super(NO_VERTICAL_SCROLL | USE_ALL_HEIGHT);
		this.elFamiliar = elFamiliar;
		setComponents();
	}

	public Familiar getFamiliar()
	{
		return this.elFamiliar;
	}
	public void setListComponents()
	{
		
		Font font = getFont().derive(Font.PLAIN, 6, Ui.UNITS_pt);
		int width = font.getAdvance("Telefono Prim");
		
        lblNombreFamiliar = new CustomListElement("Nombre", elFamiliar.getPersona().getNombre_Persona_1()+" "+
        											
    												(elFamiliar.getPersona().getNombre_Persona_2() == null ? "" : elFamiliar.getPersona().getNombre_Persona_2() ), width) 
        {
			protected void paintBackground( Graphics g ) 
			{
				//// Modificacion para colores...
				///
				//
					COLOR_BACKGROUND_FOCUS = Constant.COLOR_FOCUS_NORMAL;
					COLOR_BACKGROUND_FOCUS_ACTION = Constant.COLOR_LIST_FOCUS;
				//
				///
				////
					
				
				  if( _drawPosition < 0 ) 
				  {
			          // it's like a list field, let the default background be drawn
			          super.paintBackground( g );
			          return;
			      }
			      
			      int oldColour = g.getColor();
			      int focus = COLOR_BACKGROUND_FOCUS;
			      if(_doAction)
			      {
			    	  focus = COLOR_BACKGROUND_FOCUS_ACTION;
			      }
			      
			      int background = g.isDrawingStyleSet( Graphics.DRAWSTYLE_FOCUS ) ? focus : Constant.COLOR_BACKGROUND;
			      
			      try 
			      {
			    	  
			          if( _drawPosition == 0 ) 
			          {
			              // Top
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else if( _drawPosition == 1 ) 
			          {
			              // Bottom 
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			          } 
			          else if( _drawPosition == 2 ) 
			          {
			              // Middle
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else 
			          {
			              // Single
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			          }
			          g.drawLine(_preferedWidth+SEPARATOR_LONG, 0, _preferedWidth+SEPARATOR_LONG, getHeight());
			      } 
			      finally 
			      {
			          g.setColor( oldColour );
			      }
			  }
		}; 
		lblApellidoFamiliar = new CustomListElement("Apellido", elFamiliar.getPersona().getApellido_Persona_1()+" "+
														(elFamiliar.getPersona().getApellido_Persona_2() == null ? "" : elFamiliar.getPersona().getApellido_Persona_2()), width) 
		{
			protected void paintBackground( Graphics g ) 
			{
				//// Modificacion para colores...
				///
				//
					COLOR_BACKGROUND_FOCUS = Constant.COLOR_FOCUS_NORMAL;
					COLOR_BACKGROUND_FOCUS_ACTION = Constant.COLOR_LIST_FOCUS;
				//
				///
				////
					
				
				  if( _drawPosition < 0 ) 
				  {
			          // it's like a list field, let the default background be drawn
			          super.paintBackground( g );
			          return;
			      }
			      
			      int oldColour = g.getColor();
			      int focus = COLOR_BACKGROUND_FOCUS;
			      if(_doAction) 
			    	  focus = COLOR_BACKGROUND_FOCUS_ACTION;
			      
			      int background = g.isDrawingStyleSet( Graphics.DRAWSTYLE_FOCUS ) ? focus : Constant.COLOR_BACKGROUND;
			      
			      try 
			      {
			    	  
			          if( _drawPosition == 0 ) 
			          {
			              // Top
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else if( _drawPosition == 1 ) 
			          {
			              // Bottom 
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			          } 
			          else if( _drawPosition == 2 ) 
			          {
			              // Middle
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else 
			          {
			              // Single
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			          }
			          g.drawLine(_preferedWidth+SEPARATOR_LONG, 0, _preferedWidth+SEPARATOR_LONG, getHeight());
			      } 
			      finally 
			      {
			          g.setColor( oldColour );
			      }
			  }
		};
		lblFechaNacFamiliar = new CustomListElement("Fecha de Nacimiento", 
				Tool.getInstance().parseDateToString(elFamiliar.getPersona().getFecha_Nacimiento(),6), width) 
		{
			protected void paintBackground( Graphics g ) 
			{
				//// Modificacion para colores...
				///
				//
					COLOR_BACKGROUND_FOCUS = Constant.COLOR_FOCUS_NORMAL;
					COLOR_BACKGROUND_FOCUS_ACTION = Constant.COLOR_LIST_FOCUS;
				//
				///
				////
					
				
				  if( _drawPosition < 0 ) 
				  {
			          // it's like a list field, let the default background be drawn
			          super.paintBackground( g );
			          return;
			      }
			      
			      int oldColour = g.getColor();
			      int focus = COLOR_BACKGROUND_FOCUS;
			      if(_doAction) 
			    	  focus = COLOR_BACKGROUND_FOCUS_ACTION;
			      
			      int background = g.isDrawingStyleSet( Graphics.DRAWSTYLE_FOCUS ) ? focus : Constant.COLOR_BACKGROUND;
			      
			      try 
			      {
			    	  
			          if( _drawPosition == 0 ) 
			          {
			              // Top
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else if( _drawPosition == 1 ) 
			          {
			              // Bottom 
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			          } 
			          else if( _drawPosition == 2 ) 
			          {
			              // Middle
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else 
			          {
			              // Single
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			          }
			          g.drawLine(_preferedWidth+SEPARATOR_LONG, 0, _preferedWidth+SEPARATOR_LONG, getHeight());
			      } 
			      finally 
			      {
			          g.setColor( oldColour );
			      }
			  }
		};
		lblSexoFamiliar = new CustomListElement("Sexo", elFamiliar.getPersona().getSexo_Persona(), width) 
		{
			protected void paintBackground( Graphics g ) 
			{
				//// Modificacion para colores...
				///
				//
					COLOR_BACKGROUND_FOCUS = Constant.COLOR_FOCUS_NORMAL;
					COLOR_BACKGROUND_FOCUS_ACTION = Constant.COLOR_LIST_FOCUS;
				//
				///
				////
					
				
				  if( _drawPosition < 0 ) 
				  {
			          // it's like a list field, let the default background be drawn
			          super.paintBackground( g );
			          return;
			      }
			      
			      int oldColour = g.getColor();
			      int focus = COLOR_BACKGROUND_FOCUS;
			      if(_doAction) 
			    	  focus = COLOR_BACKGROUND_FOCUS_ACTION;
			      
			      int background = g.isDrawingStyleSet( Graphics.DRAWSTYLE_FOCUS ) ? focus : Constant.COLOR_BACKGROUND;
			      
			      try 
			      {
			    	  
			          if( _drawPosition == 0 ) 
			          {
			              // Top
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else if( _drawPosition == 1 ) 
			          {
			              // Bottom 
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			          } 
			          else if( _drawPosition == 2 ) 
			          {
			              // Middle
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else 
			          {
			              // Single
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			          }
			          g.drawLine(_preferedWidth+SEPARATOR_LONG, 0, _preferedWidth+SEPARATOR_LONG, getHeight());
			      } 
			      finally 
			      {
			          g.setColor( oldColour );
			      }
			  }
		};
		lblParentescoNombre = new CustomListElement("Parentesco", elFamiliar.getParentesco().getNombreParentesco(), width) 
		{
			protected void paintBackground( Graphics g ) 
			{
				//// Modificacion para colores...
				///
				//
					COLOR_BACKGROUND_FOCUS = Constant.COLOR_FOCUS_NORMAL;
					COLOR_BACKGROUND_FOCUS_ACTION = Constant.COLOR_LIST_FOCUS;
				//
				///
				////
					
				
				  if( _drawPosition < 0 ) 
				  {
			          // it's like a list field, let the default background be drawn
			          super.paintBackground( g );
			          return;
			      }
			      
			      int oldColour = g.getColor();
			      int focus = COLOR_BACKGROUND_FOCUS;
			      if(_doAction) 
			    	  focus = COLOR_BACKGROUND_FOCUS_ACTION;
			      
			      int background = g.isDrawingStyleSet( Graphics.DRAWSTYLE_FOCUS ) ? focus : Constant.COLOR_BACKGROUND;
			      
			      try 
			      {
			    	  
			          if( _drawPosition == 0 ) 
			          {
			              // Top
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else if( _drawPosition == 1 ) 
			          {
			              // Bottom 
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			          } 
			          else if( _drawPosition == 2 ) 
			          {
			              // Middle
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else 
			          {
			              // Single
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			          }
			          g.drawLine(_preferedWidth+SEPARATOR_LONG, 0, _preferedWidth+SEPARATOR_LONG, getHeight());
			      } 
			      finally 
			      {
			          g.setColor( oldColour );
			      }
			  }
		};
		lblCiFamiliar = new CustomListElement("CI", elFamiliar.getPersona().getCedula_Persona(), width) 
		{
			protected void paintBackground( Graphics g ) 
			{
				//// Modificacion para colores...
				///
				//
					COLOR_BACKGROUND_FOCUS = Constant.COLOR_FOCUS_NORMAL;
					COLOR_BACKGROUND_FOCUS_ACTION = Constant.COLOR_LIST_FOCUS;
				//
				///
				////
					
				
				  if( _drawPosition < 0 ) 
				  {
			          // it's like a list field, let the default background be drawn
			          super.paintBackground( g );
			          return;
			      }
			      
			      int oldColour = g.getColor();
			      int focus = COLOR_BACKGROUND_FOCUS;
			      if(_doAction) 
			    	  focus = COLOR_BACKGROUND_FOCUS_ACTION;
			      
			      int background = g.isDrawingStyleSet( Graphics.DRAWSTYLE_FOCUS ) ? focus : Constant.COLOR_BACKGROUND;
			      
			      try 
			      {
			    	  
			          if( _drawPosition == 0 ) 
			          {
			              // Top
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else if( _drawPosition == 1 ) 
			          {
			              // Bottom 
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			          } 
			          else if( _drawPosition == 2 ) 
			          {
			              // Middle
			              g.setColor( background );
			              g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
			              g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
			          } 
			          else 
			          {
			              // Single
			              g.setColor( background );
			              g.fillRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			              g.setColor( COLOR_BORDER );
			              g.drawRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
			          }
			          g.drawLine(_preferedWidth+SEPARATOR_LONG, 0, _preferedWidth+SEPARATOR_LONG, getHeight());
			      } 
			      finally 
			      {
			          g.setColor( oldColour );
			      }
			  }
		};
		
		
        _content.add( lblNombreFamiliar );
        _content.add( lblApellidoFamiliar );
        _content.add( lblCiFamiliar );
        _content.add( lblParentescoNombre );
        _content.add( lblFechaNacFamiliar );
        _content.add( lblSexoFamiliar );
        
        twoColumnManager.add(_content);
		
	}
	public void setComponents() 
	{
		setTitle("Detalle del Familiar");
		_foreground = new ForegroundManager();
		//_bodyWrapper = new NegativeMarginVerticalFieldManager(USE_ALL_WIDTH);
		
		twoColumnManager = new TwoColumnFieldManager( Display.getWidth() / 2, USE_ALL_WIDTH );
        twoColumnManager.setBorder( BorderFactory.createBitmapBorder( new XYEdges( 10, 10, 10, 10 ), Bitmap.getBitmapResource( "border_simple_white.png" ) ) );
        twoColumnManager.setMargin( 6, 6, 6, 6 );
        twoColumnManager.setPadding( 2, 2, 2, 2 );
        
        Field left;
        
        left = new LabelField( elFamiliar.getPersona().getNombre_Persona_1() +", "+
        						elFamiliar.getPersona().getApellido_Persona_1() , 
        						FIELD_HCENTER |
								FIELD_VCENTER |
								LabelField.USE_ALL_WIDTH |
								DrawStyle.HCENTER |
								DrawStyle.VCENTER);
        left.setFont(font_bold_8);
        
        foto_familiar = new URLBitmapField();
        if (elFamiliar.getPersona().getFoto_Persona() == null)
        {
        	foto_familiar.setBitmap(Tool.getInstance().getContactoBlanco());
        }
        else
        {
        	foto_familiar.setBitmap(elFamiliar.getPersona().getFoto_Persona());
        }
        
        //foto_comida.setMargin( 0, 10, 0, 10 );
        
        TwoColumnFieldManager twoColumnManager_Image_Icon = new TwoColumnFieldManager( foto_familiar.getWidth() , FIELD_HCENTER );
        twoColumnManager_Image_Icon.setBorder( BorderFactory.createBitmapBorder( new XYEdges( 10, 10, 10, 10 ), Bitmap.getBitmapResource( "border_simple_white.png" ) ) );
        twoColumnManager_Image_Icon.setMargin( 6, 0, 6, 0 );
        //twoColumnManager.setPadding( 6, 6, 6, 6 );
        
        twoColumnManager_Image_Icon.add(foto_familiar);
        twoColumnField = new TwoColumnField(twoColumnManager_Image_Icon,
												left,
												FIELD_HCENTER);

		twoColumnManager.add( twoColumnField );

		lblInformacionPersonal = new LabelField("Informacion Personal", LabelField.HCENTER | FIELD_HCENTER);
        lblInformacionPersonal.setFont(font_italic_7);
        
		twoColumnManager.add ( lblInformacionPersonal );
		Field separator = new SeparatorField();
        separator.setMargin( 2, 0, 2, 0 );
        twoColumnManager.add( separator );

        _content = new ListStyleButtonSetManager();
        
        setListComponents();
        
        _foreground.add(twoColumnManager);
        add(_foreground);
        
	}
	

}
